@echo off
chcp 65001
echo \usepackage{listings}
echo 
echo % 定义 JSON 语言
echo \lstdefinelanguage{JSON}{
echo     basicstyle=\ttfamily\small,
echo     numbers=left,
echo     numberstyle=\tiny,
echo     stepnumber=1,
echo     numbersep=5pt,
echo     showstringspaces=false,
echo     breaklines=true,
echo     frame=lines,
echo     morestring=[b]",
echo     moredelim=[s][\bfseries\color{blue}]{\{}{\}},
echo     moredelim=[s][\bfseries\color{blue}]{[}{]},
echo     morecomment=[l]{//},          % 单行注释
echo     morecomment=[s]{/*}{*/},       % 多行注释
echo     stringstyle=\color{red},
echo     keywordstyle=\color{blue},
echo     keywords={true,false,null},
echo     backgroundcolor=\color{gray!10} % 添加背景颜色
echo }
echo 
echo \begin{document}
echo 
echo \section*{JSON 示例}
echo 
echo \begin{lstlisting}[language=JSON, breaklines=true]
echo {
echo     "name": "Alice",
echo     "age": 25,
echo     // 城市
echo     "city": "Beijing"
echo }
echo \end{lstlisting}
echo 
echo \end{document}

pause